package object;

import java.util.concurrent.TimeUnit;

/**
 * @author mubei
 * @date 2021/12/20
 * @description
 */
public class Finalize {

    public static void main(String[] args) {
        Car bwm = new Car();

        bwm = null;
        System.gc();
        System.out.println("退出了");
    }
}

class Car{
    @Override
    protected void finalize() throws Throwable {
        System.out.println("销毁汽车 销毁某些资源");
    }
}
